home *** CD-ROM | disk | FTP | other *** search
- Path: pacifica.access.ch!usenet
- From: tombeck@usemail.com (Thomas Beck)
- Newsgroups: comp.lang.c++
- Subject: Please please help a newbie!
- Date: 14 Feb 1996 22:41:12 GMT
- Organization: Internet Access AG, Zuerich, Switzerland
- Message-ID: <4ftoe8$5a2@pacifica.access.ch>
- NNTP-Posting-Host: gatezh1-02.access.ch
- X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
-
- Hi there!
-
- It's quite embarrassing to ask those two questions, because they seem
- absolutely stupid (they probably are). Yesterday I started to learn C/C++. I
- bought a 700 pages book with a cd included that has two compilers on it). I
- fully understand the chapter about the types, but the things I program just
- can't be compiled. I extracted the following two problems:
-
- ----------- example 1: -------------
- int i;
- int & a=i;
-
- main() {
- }
- --------------------------------------------
-
- This is not compiled, I get the following output with Symantec C++ 6.11:
-
- D:\SC>sc test1.c
-
- sccx test1.c
- int & a=i;
- ^
- test1.c(2) : Error: '=', ';' or ',' expected
-
- --- errorlevel 1
-
- The second thing that doesn't work is this:
-
- ----------- example 2: -------------
- struct abc {
- int i;
- char a;
- void f1() {
- };
- };
-
- main() {
- }
- ---------------------------------------------
-
- This isn't compiled either, here's the output:
-
- D:\SC>sc test2.c
-
- sccx test2.c
- void f1() {
- ^
- test2.c(4) : Error: illegal type for 'f1' member
-
- --- errorlevel 1
-
-
- Before you think I'm absolutely stupid... I used to be very good at Pascal
- (TP 6.0), and I'm also experienced in OOP under Pascal. I have no clue of
- C++, however, and I can only rely on what's written in that book. Apparently
- it doesn't tell me the truth, does it?
-
- Can you please help me with those two problems (referenced variable and
- function within a class), so that I can go on and learn a few more difficult
- things?
-
- Thanks in advance,
-
- Thomas Beck, tombeck@usemail.com
-
- =================================================================
- Summer's day, as she passed away. Birds were singing in the
- summer sky; then came the rain, and once again, a tear fell
- from her mother's eye...
- =================================================================
-
-